package com.ccx.library.module.user.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.ccx.library.Interceptor.converter.StatusConverter;
import com.ccx.library.function.annotation.TimeAt;
import com.ccx.library.util.SnowflakeUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName(value = "user")
public class User implements Serializable {
    @TableId(value = "user_id",type = IdType.ID_WORKER_STR)
    @ExcelProperty("用户编号")
    private String userId;
    @ExcelProperty("用户账号")
    @TableField(value = "username")
    private String username;
    @ExcelProperty("昵称")
    @TableField(value = "nickname")
    private String nickname;
    @ExcelProperty("密码")
    private String password;
    @ExcelProperty(value = "状态",converter = StatusConverter.class)
    private Integer status;
    @ExcelProperty(value = "回收状态",converter = StatusConverter.class)
    private Integer flag;
    @ExcelProperty("手机")
    private String phone;
    @ExcelProperty("头像")
    private String img;
    @ExcelProperty("简介")
    private String info;
    @ExcelProperty("等级")
    private Integer level;
    @ExcelProperty("邮箱")
    private String email;
    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TimeAt
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;
}
